home *** CD-ROM | disk | FTP | other *** search
/ Freelog 22 / freelog 22.iso / Prog / Djgpp / DJDEV203.ZIP / include / stdarg.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-25  |  1.1 KB  |  50 lines

  1. /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
  2. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  3. #ifndef __dj_include_stdarg_h_
  4. #define __dj_include_stdarg_h_
  5.  
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9.  
  10. #ifndef __dj_ENFORCE_ANSI_FREESTANDING
  11.  
  12. #ifdef __dj_include_varargs_h_
  13. #error stdarg.h and varargs.h are mutually exclusive
  14. #endif
  15.  
  16. #include <sys/djtypes.h>
  17.  
  18. __DJ_va_list
  19. #undef __DJ_va_list
  20. #define __DJ_va_list
  21.   
  22. #define __dj_va_rounded_size(T)  \
  23.   (((sizeof (T) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
  24.  
  25. #define va_arg(ap, T) \
  26.     (ap = (va_list) ((char *) (ap) + __dj_va_rounded_size (T)),    \
  27.      *((T *) (void *) ((char *) (ap) - __dj_va_rounded_size (T))))
  28.  
  29. #define va_end(ap)
  30.  
  31. #define va_start(ap, last_arg) \
  32.  (ap = ((va_list) __builtin_next_arg (last_arg)))
  33.   
  34. #ifndef __STRICT_ANSI__
  35.  
  36. #ifndef _POSIX_SOURCE
  37.  
  38. #endif /* !_POSIX_SOURCE */
  39. #endif /* !__STRICT_ANSI__ */
  40. #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
  41.  
  42. #ifndef __dj_ENFORCE_FUNCTION_CALLS
  43. #endif /* !__dj_ENFORCE_FUNCTION_CALLS */
  44.  
  45. #ifdef __cplusplus
  46. }
  47. #endif
  48.  
  49. #endif /* !__dj_include_stdarg_h_ */
  50.